<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="Hexo Theme Redefine">
    
    <meta name="author" content="xiaoeryu">
    <!-- preconnect -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

    
    <!--- Seo Part-->
    
    <link rel="canonical" href="https://xiaoeeyu.github.io/2023/09/04/dalvik下一代壳的通用解决方案/"/>
    <meta name="robots" content="index,follow">
    <meta name="googlebot" content="index,follow">
    <meta name="revisit-after" content="1 days">
    
    
    
        
        <meta name="description" content="本节主要分析在Dalvik时代怎么做到把壳脱下来的，通过Android 4.x的源码跟踪一下系统帮我们加载dex时候的流程，分析一下脱壳的原理和时机。">
<meta property="og:type" content="article">
<meta property="og:title" content="Dalvik下一代壳的通用解决方案">
<meta property="og:url" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/index.html">
<meta property="og:site_name" content="xiaoeryu">
<meta property="og:description" content="本节主要分析在Dalvik时代怎么做到把壳脱下来的，通过Android 4.x的源码跟踪一下系统帮我们加载dex时候的流程，分析一下脱壳的原理和时机。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/541a0875d28a486e802c19d42d9ea07d.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/6d588821ac6a49788bcfde3cab556277.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/79c707843631456e95a9d1a959c228db.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/b8f6c7e6e90b465bb0950982972f97d7.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/e94a843bd81f4706a8f0255d9fe31303.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/f55c2e61f10a4a4a9ca8a3f50a34456d.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/8c008213cf73475982e16ea3210e5366.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/a2a5da1a1c20463188e47b214680dd31.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/f6aa7aefa24a43fbb85fffd6c71ffc8c.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/0b378bde0f6944dc9ac2a0d2aa380b95.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/b3ebad68e5804063b2f30bbc6c4a8af7.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/0b324a89a4134fe8b6d1aec5532f39c0.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/5013afa2630f4d52bb42a6b085afc86e.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/2c3931c242ea4a2d90d6b58ac8a75b45.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/6078b8cc85a04fe39e3cbdaf3e84db49.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/4be8759a925b48be9ea1acb4b1eb1243.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/4b9efd34274c4aa9b183d2a3d48b9190.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/bb5d578d69c14246a7f3d2db34cfcbc0.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/13893ad99cfd439d9d46825246e47172.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/289809c3fcce46b49d86cae224869386.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/96cd7202d89848a8b833f43f144d48b4.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/9f78499abb2246af9d3b7fe144a321b3.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/ccce026a5d9d4129874367ba28d92307.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/2be6a2e843f9499093c2ccc7be071239.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/ba015ce7934b467ca020e0d84f83b2e4.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/688bcd18cda143d288bdb5befbf92172.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/6e86b9e723994230a787bea30e8b6887.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/63e1f836d04b4287bf78de4ebef824f3.png">
<meta property="og:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/ac9d2c8c4908415bbb602018631e792b.png">
<meta property="article:published_time" content="2023-09-03T16:07:34.000Z">
<meta property="article:modified_time" content="2023-09-14T01:41:07.542Z">
<meta property="article:author" content="xiaoeryu">
<meta property="article:tag" content="Android脱壳">
<meta property="article:tag" content="学习笔记">
<meta property="article:tag" content="Android源码分析">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xiaoeeyu.github.io/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/541a0875d28a486e802c19d42d9ea07d.png">
    
    
    <!--- Icon Part-->
    <link rel="icon" type="image/png" href="/images/rabete.jpg" sizes="192x192">
    <link rel="apple-touch-icon" sizes="180x180" href="/images/rabete.jpg">
    <meta name="theme-color" content="#A31F34">
    <link rel="shortcut icon" href="/images/rabete.jpg">
    <!--- Page Info-->
    
    <title>
        
            Dalvik下一代壳的通用解决方案 | xiaoeryu
        
    </title>

    
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">


    <!--- Inject Part-->
    

    
<link rel="stylesheet" href="/css/style.css">


    
        
<link rel="stylesheet" href="/css/build/tailwind.css">

    

    
<link rel="stylesheet" href="/fonts/GeistMono/geist-mono.css">

    
<link rel="stylesheet" href="/fonts/Geist/geist.css">

    <!--- Font Part-->
    
    
    
    
    
    

    <script id="hexo-configurations">
    window.config = {"hostname":"xiaoeeyu.github.io","root":"/","language":"zh-CN","path":"search.xml"};
    window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"delete_mask":false,"title_alignment":"left","headings_top_spacing":{"h1":"3.2rem","h2":"2.4rem","h3":"1.9rem","h4":"1.6rem","h5":"1.4rem","h6":"1.3rem"}},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","highlight_theme":{"light":"github","dark":"vs2015"},"font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":4,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"pangu_js":false,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/ball-0101.jpg","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null,"default_mode":"light"},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null},"title":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":{"enable":false,"custom_message":null},"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-jxl31y.png","dark":"/images/wallhaven-o5762l.png"},"title":"XIAOERYU","subtitle":{"text":["明心见性，拨云见日","Don't wait, to create"],"hitokoto":{"enable":false,"show_author":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"style":"default","links":{"github":"https://github.com/xiaoeeyu","instagram":null,"zhihu":null,"twitter":null,"email":"xiaoeryu@163.com"},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null,"lrc":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.8.2","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"width":{"home":"1200px","pages":"1000px"},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"show_on_mobile":true,"links":null},"article_date_format":"auto","excerpt_length":200,"categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
    window.lang_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
    window.data = {"masonry":false};
  </script>
    
    <!--- Fontawesome Part-->
    
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">

    
<link rel="stylesheet" href="/fontawesome/brands.min.css">

    
<link rel="stylesheet" href="/fontawesome/solid.min.css">

    
<link rel="stylesheet" href="/fontawesome/regular.min.css">

    
    
    
    
<meta name="generator" content="Hexo 6.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; }  .github-emoji > span { position: relative; z-index: 10; }  .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; }  .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
</head>



<body>
	<div class="progress-bar-container">
	

	
	<span class="pjax-progress-bar"></span>
	<!--        <span class="swup-progress-icon">-->
	<!--            <i class="fa-solid fa-circle-notch fa-spin"></i>-->
	<!--        </span>-->
	
</div>

<main class="page-container" id="swup">

	

	<div class="main-content-container flex flex-col justify-between min-h-dvh">
		<div class="main-content-header">
			<header class="navbar-container px-6 md:px-12">
    <div class="navbar-content transition-navbar ">
        <div class="left">
            
                <a class="logo-image h-8 w-8 sm:w-10 sm:h-10 mr-3" href="/">
                    <img src="/images/rabete.jpg" class="w-full h-full rounded-sm">
                </a>
            
            <a class="logo-title" href="/">
                
                xiaoeryu
                
            </a>
        </div>

        <div class="right">
            <!-- PC -->
            <div class="desktop">
                <ul class="navbar-list">
                    
                        
                            

                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class=""
                                   href="/"
                                        >
                                    <i class="fa-regular fa-house fa-fw"></i>
                                    首页
                                    
                                </a>

                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            

                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class=""
                                   href="/archives"
                                        >
                                    <i class="fa-regular fa-archive fa-fw"></i>
                                    归档
                                    
                                </a>

                                <!-- Submenu -->
                                
                            </li>
                    
                    
                        <li class="navbar-item search search-popup-trigger">
                            <i class="fa-solid fa-magnifying-glass"></i>
                        </li>
                    
                </ul>
            </div>
            <!-- Mobile -->
            <div class="mobile">
                
                    <div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i>
                    </div>
                
                <div class="icon-item navbar-bar">
                    <div class="navbar-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- Mobile sheet -->
    <div class="navbar-drawer h-dvh w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
        <ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
            
                
                    

                    <li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
                        
                        <a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
                           href="/"
                        >
                            <span>
                                首页
                            </span>
                            
                                <i class="fa-regular fa-house fa-sm fa-fw"></i>
                            
                        </a>
                        

                        
                    </li>
            
                
                    

                    <li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
                        
                        <a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
                           href="/archives"
                        >
                            <span>
                                归档
                            </span>
                            
                                <i class="fa-regular fa-archive fa-sm fa-fw"></i>
                            
                        </a>
                        

                        
                    </li>
            

            
            
        </ul>

        <div class="statistics flex justify-around my-2.5">
    <a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
        <div class="number text-2xl sm:text-xl text-second-text-color font-semibold">92</div>
        <div class="label text-third-text-color text-sm">标签</div>
    </a>
    <a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
        <div class="number text-2xl sm:text-xl text-second-text-color font-semibold">14</div>
        <div class="label text-third-text-color text-sm">分类</div>
    </a>
    <a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
        <div class="number text-2xl sm:text-xl text-second-text-color font-semibold">112</div>
        <div class="label text-third-text-color text-sm">文章</div>
    </a>
</div>
    </div>

    <div class="window-mask"></div>

</header>


		</div>

		<div class="main-content-body transition-fade-up">
			

			<div class="main-content">
				<div class="post-page-container flex relative justify-between box-border w-full h-full">
	<div class="article-content-container">

		<div class="article-title relative w-full">
			
			<div class="w-full flex items-center pt-6 justify-start">
				<h1 class="article-title-regular text-second-text-color tracking-tight text-4xl md:text-6xl font-semibold px-2 sm:px-6 md:px-8 py-3">Dalvik下一代壳的通用解决方案</h1>
			</div>
			
		</div>

		
		<div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
			<div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
				<img src="/images/rabete.jpg">
			</div>
			<div class="info flex flex-col justify-between">
				<div class="author flex items-center">
					<span class="name text-default-text-color text-lg font-semibold">xiaoeryu</span>
					
					<span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv5</span>
					
				</div>
				<div class="meta-info">
					<div class="article-meta-info">
    <span class="article-date article-meta-item">
        <i class="fa-regular fa-pen-fancy"></i>&nbsp;
        <span class="desktop">2023-09-04 00:07:34</span>
        <span class="mobile">2023-09-04 00:07:34</span>
        <span class="hover-info">创建</span>
    </span>
    
        <span class="article-date article-meta-item">
            <i class="fa-regular fa-wrench"></i>&nbsp;
            <span class="desktop">2023-09-14 09:41:07</span>
            <span class="mobile">2023-09-14 09:41:07</span>
            <span class="hover-info">更新</span>
        </span>
    

    
        <span class="article-categories article-meta-item">
            <i class="fa-regular fa-folders"></i>&nbsp;
            <ul>
                
                
                    
                        
                        <li>
                            <a href="/categories/Android%E9%80%86%E5%90%91/">Android逆向</a>&nbsp;
                        </li>
                    
                    
                
            </ul>
        </span>
    
    
        <span class="article-tags article-meta-item">
            <i class="fa-regular fa-tags"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/tags/Android%E8%84%B1%E5%A3%B3/">Android脱壳</a>&nbsp;
                    </li>
                
                    <li>
                        | <a href="/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a>&nbsp;
                    </li>
                
                    <li>
                        | <a href="/tags/Android%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/">Android源码分析</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    

    
    
    
    
        <span class="article-pv article-meta-item">
            <i class="fa-regular fa-eye"></i>&nbsp;<span id="busuanzi_value_page_pv"></span>
        </span>
    
</div>

				</div>
			</div>
		</div>
		

		


		<div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
			<p>本节主要分析在Dalvik时代怎么做到把壳脱下来的，通过<strong>Android 4.x</strong>的源码跟踪一下系统帮我们加载dex时候的流程，分析一下脱壳的原理和时机。</p>
<span id="more"></span>

<h2 id="Dalvik下DexClassLoader加载dex源码流程分析"><a href="#Dalvik下DexClassLoader加载dex源码流程分析" class="headerlink" title="Dalvik下DexClassLoader加载dex源码流程分析"></a>Dalvik下DexClassLoader加载dex源码流程分析</h2><p><a class="link" target="_blank" rel="noopener" href="http://androidxref.com/">源码网址<i class="fa-solid fa-arrow-up-right ml-[0.2em] font-light align-text-top text-[0.7em] link-icon"></i></a></p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/541a0875d28a486e802c19d42d9ea07d.png" class="" title="84070f0817edd69f1ec2c8dec32410f7.png">

<p>在libcore中查找DexClassLoader函数</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/6d588821ac6a49788bcfde3cab556277.png" class="" title="ae2cce5b54f6d6992720f5ec5c3d439e.png">

<ul>
<li>可以看到它继承自BaseDexClassLoader()，这个函数里面只有一个构造函数没有太多的内容。接下来继续跟进BaseDexClassLoader()看一下</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/79c707843631456e95a9d1a959c228db.png" class="" title="d3591dddf27451ca612f8070f3549efe.png">

<ul>
<li>这个函数功能比较简单，将我们当前的ClassLoader的父节点设置为我们传入的parent，之后new了一个DexPathList()进行初始化，那就跟进去看它传递的参数是什么</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/b8f6c7e6e90b465bb0950982972f97d7.png" class="" title="16bd1f55fd61e0502517634e4368eaa5.png">

<ul>
<li><p>DexPathList()的第一个参数是ClassLoader第二个才是我们要加载的DEX文件路径，之后的一些if判断对参数进行了一些校验，可以看到下面的makeDexElements()传入了<strong>dexPath</strong>，我们继续跟踪这个函数看一下</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/e94a843bd81f4706a8f0255d9fe31303.png" class="" title="554171a06d0379744ff5f02742c2cde3.png">

<ul>
<li><p><em>进来之后可以看到它的返回值是一个Element[]数组，在FART当中也会对Element这个匿名内部类有一定涉及，它也在DexPathList类当中进行了定义</em></p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/f55c2e61f10a4a4a9ca8a3f50a34456d.png" class="" title="a95612028d79319ecd1e2179060c522c.png">

<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/8c008213cf73475982e16ea3210e5366.png" class="" title="0eee385d01e6ef7b46c9f07620f947ad.png">
</li>
<li><p><em>从定义中可以看到它的参数中有包含DexFile对象，接下来还回过头去看makeDexElements()</em></p>
</li>
</ul>
</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/a2a5da1a1c20463188e47b214680dd31.png" class="" title="2eef41f4fd99366cc5e1c25e133d7dc2.png">

<ul>
<li>可以看到这里面就调用了LoadDexFile()，在调用完之后再将这个DEX添加到Elements[]数组当中，接下来我们跟进LoadDexFile()去看一下</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/f6aa7aefa24a43fbb85fffd6c71ffc8c.png" class="" title="23aac5300998fc787c34492efd88eb6c.png">

<ul>
<li>在LoadDexFile当中再次调用了DexFile类当中的loadDex(<strong>传入了三个参数</strong>)，跟进DexFile类看一下loadDex()</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/0b378bde0f6944dc9ac2a0d2aa380b95.png" class="" title="a52a6742c3af6dbc47574810a55b43c1.png">

<ul>
<li>传入的第一个参数是我们跟的dex路径，DexFile的返回值是new了一个DexFile的对象，继续跟进去看一下</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/b3ebad68e5804063b2f30bbc6c4a8af7.png" class="" title="8ca1b132811c6067292b19ad1b0b3cef.png">

<ul>
<li>在这里面又调用了openDexFile()来先对DEX进行处理，然后返回mCookie。我们继续跟进看一下</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/0b324a89a4134fe8b6d1aec5532f39c0.png" class="" title="29349eb061356eb81db201ff3dd50b17.png">

<ul>
<li>到这里我们看里面调用函数的名字就知道它进入了Native层来处理，是使用C/C++来实现的，再往下等后面学习NDK开发的时候还会涉及到这些。</li>
</ul>
<h3 id="查找CPP源码"><a href="#查找CPP源码" class="headerlink" title="查找CPP源码"></a>查找CPP源码</h3><h4 id="第一种方法"><a href="#第一种方法" class="headerlink" title="第一种方法"></a>第一种方法</h4><p>我们在Android源码当中检索cpp的时候实际上每一个java类他当中的GNI实现是有一个规律的</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/5013afa2630f4d52bb42a6b085afc86e.png" class="" title="8e17976db0b4b23f45049cd0bd1f5af9.png">

<ul>
<li>比如说我们当前的类在，dalvik/system/DexFile.java中，那么它对应的cpp实现就在<strong>dalvik_system_DexFile</strong>中，就是把路径用下划线分割的CPP文件名</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/2c3931c242ea4a2d90d6b58ac8a75b45.png" class="" title="3fa2e1ab0529ad7ebbe20899316e7f09.png">

<ul>
<li>我们就可以在dalvik下面找到这个cpp文件，要打开这个文件我们只需要去这个路径下面去就可以了</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/6078b8cc85a04fe39e3cbdaf3e84db49.png" class="" title="fc32fc3530b9f503f9b7607af8852165.png">

<h4 id="第二种方法"><a href="#第二种方法" class="headerlink" title="第二种方法"></a>第二种方法</h4><p>直接在dalvik()中检索这个函数名</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/4be8759a925b48be9ea1acb4b1eb1243.png" class="" title="5b7d470877b7244818b59ee8a6a04ccf.png">

<p><strong>找到了CPP</strong><br>进来这个函数之后</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/4b9efd34274c4aa9b183d2a3d48b9190.png" class="" title="1d6c912b06c33b73efe93f9b675e7baf.png">

<ul>
<li>进来之后会先对当前文件进行一个校验判断是否是**.dex**后缀，校验通过了再进入dvmRawDexFileOpen()进行加载。跟进去看一下</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/bb5d578d69c14246a7f3d2db34cfcbc0.png" class="" title="d580fbb8e5c68783f64b376e0f7c0bc4.png">

<ul>
<li>进来之后这个函数比较长，它先执行了一些魔术头校验、设置文件优化后路径等操作，我们先继续跟进看一下这个文件优化<strong>dvmOptimizeDexFile()</strong></li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/13893ad99cfd439d9d46825246e47172.png" class="" title="1f694562790afb6698189f114e44b096.png">

<ul>
<li><p>这个函数也比较长，但是它的主要作用就是调用**/bin/dexopt<strong>生成优化后的</strong>odex**文件然后返回，下面我们去分析一下dexopt的源码</p>
<ul>
<li>寻找<a class="link" target="_blank" rel="noopener" href="http://androidxref.com/4.4.4_r1/xref/dalvik/dexopt/">dexopt<i class="fa-solid fa-arrow-up-right ml-[0.2em] font-light align-text-top text-[0.7em] link-icon"></i></a></li>
</ul>
</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/289809c3fcce46b49d86cae224869386.png" class="" title="1bc16591b10061e28d4aac33db9f381b.png">

<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/96cd7202d89848a8b833f43f144d48b4.png" class="" title="d9d73b9e09ea02e2866d8aff953cf75b.png">

<ul>
<li>进来之后main()函数会先看我们传入的是什么文件，如果是<strong>dex</strong>文件就执行fromDex()。继续跟进去看一下</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/9f78499abb2246af9d3b7fe144a321b3.png" class="" title="eda1c3a92f7ceec9286e08956df9b63b.png">

<ul>
<li>进来之后先进行了一系列的优化前的准备，准备完成的话就开始调用**dvmContinueOptimization()**方法进行优化。继续跟进</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/ccce026a5d9d4129874367ba28d92307.png" class="" title="a0b7acd35030831bc11625290b183d24.png">

<ul>
<li><ul>
<li><p>进来之后呢，会将dex文件映射到内存，然后对文件进行一个重写。我们先跟进去看rewriteDex()是怎么重写的</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/2be6a2e843f9499093c2ccc7be071239.png" class="" title="49f03c85b0ab7c60f1c645f5d0f40f13.png">

<ul>
<li>进来这个地方内存地址和长度都有了已经可以当作一个脱壳点了，再跟进去看里面还有什么</li>
</ul>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/ba015ce7934b467ca020e0d84f83b2e4.png" class="" title="d386429d3843a0f30a95e84025bd0dc6.png">

<ul>
<li>进去之后这里也包含有起始地址和长度</li>
</ul>
<h3 id="Dalvik下通用脱壳方案"><a href="#Dalvik下通用脱壳方案" class="headerlink" title="Dalvik下通用脱壳方案"></a>Dalvik下通用脱壳方案</h3><ul>
<li><p>在Dalvik下有很多的通用脱壳教程就是对dexFileParse()、dvmDexFileOpenPartial()这两个函数下断点或者进行hook然后取出第一个和第二个参数</p>
</li>
<li><p>第一个参数就是要dump的起始地址，第二个参数就是要dump的内存区域的长度</p>
</li>
<li><p>不过在这个版本的源码中可以脱壳的地方是非常多的不止这两个地方</p>
<ol>
<li><p>比如前面用mmap()将dex文件映射到内存的地方如果对这个映射区域进行dump，就可以把从文件加载的dex给dump出来</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/688bcd18cda143d288bdb5befbf92172.png" class="" title="34a83212500e7f8a1382298bf5f2836c.png">
</li>
<li><p>还有包括这个地方也有内存中dex的起始地址和大小</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/6e86b9e723994230a787bea30e8b6887.png" class="" title="3019e6a8d570d7a75c5e19a44cddcf4d.png">
</li>
<li><p>另外进去这个rewriteDex()内部，它里面也有可以dex的起始地址和大小都可以dump下来</p>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/63e1f836d04b4287bf78de4ebef824f3.png" class="" title="ba9b9aba9565573ea17ac1939b8b4098.png"></li>
</ol>
<ul>
<li>这样看下来可以用的脱壳点还是挺多的，然后尝试手动实现一下</li>
<li>实现的方式也有很多种选择：比如可以通过hook的形式（cydia、xposed、frida等等）都可以实现对关键函数的一个hook，这种方式在后面搞xposed框架写插件的时候再尝试</li>
<li>这次我们就简单的把它当作C/C++函数在里面添加几行代码把dex文件dump出来，使用这种方式我们需要对系统源码进行一个修改定制</li>
</ul>
</li>
</ul>
<p>因为这种脱壳方式比较老了对一些变种壳可能也没有很好的作用，下面只写一下代码学习一下原理，就不拿设备实测了</p>
<pre><code class="C">    char dexfilepath[100]={0};
    int pid=getpid();
    sprintf(dexfilepath,"/sdcard/%d_%d_dvmDexFileOpenPartial.dex",len,pid); // 拼接一个保存的路径
    //fopen
    int fd=open(dexfilepath,O_CREAT|O_RDWR,0666);   // 因为很多壳都会把fopen()这些标准的C函数给hook掉，所以我们使用open()来打开文件避免使用标准读写文件函数
                                                    // 给一个合适的文件读写权限
    if(fd&gt;0)
    {
        write(fd,addr,len);
        close(fd);
    }
</code></pre>
<img lazyload="" src="/images/loading.svg" data-src="/2023/09/04/Dalvik%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E7%9A%84%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/ac9d2c8c4908415bbb602018631e792b.png" class="" title="f319eaaf42620335ab537f4e373b096a.png"></li>
</ul>
</li>
</ul>
<p><strong>下载对应的Android源码，修改脱壳点处的代码重新编译源码刷入设备即可。</strong></p>

		</div>

		
		<div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
			<div class="article-copyright-info-container">
    <ul>
        <li><strong>标题:</strong> Dalvik下一代壳的通用解决方案</li>
        <li><strong>作者:</strong> xiaoeryu</li>
        <li><strong>创建于
                :</strong> 2023-09-04 00:07:34</li>
        
            <li>
                <strong>更新于
                    :</strong> 2023-09-14 09:41:07
            </li>
        
        <li>
            <strong>链接:</strong> https://github.com/xiaoeryu/2023/09/04/Dalvik下一代壳的通用解决方案/
        </li>
        <li>
            <strong>
                版权声明:
            </strong>
            

            
                本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a> 进行许可。
            
        </li>
    </ul>
</div>

		</div>
		

		
		<ul class="post-tags-box text-lg mt-1.5 flex-wrap justify-center flex md:hidden">
			
			<li class="tag-item mx-0.5">
				<a href="/tags/Android%E8%84%B1%E5%A3%B3/">#Android脱壳</a>&nbsp;
			</li>
			
			<li class="tag-item mx-0.5">
				<a href="/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">#学习笔记</a>&nbsp;
			</li>
			
			<li class="tag-item mx-0.5">
				<a href="/tags/Android%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/">#Android源码分析</a>&nbsp;
			</li>
			
		</ul>
		

		

		
		<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
			
			<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
				<a class="prev" rel="prev" href="/2023/09/14/ART%E4%B8%8B%E4%B8%80%E4%BB%A3%E5%A3%B3%E9%80%9A%E7%94%A8%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/">
					<span class="left arrow-icon flex justify-center items-center">
						<i class="fa-solid fa-chevron-left"></i>
					</span>
					<span class="title flex justify-center items-center">
						<span class="post-nav-title-item">ART下一代壳通用解决方案</span>
						<span class="post-nav-item">上一篇</span>
					</span>
				</a>
			</div>
			
			
			<div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
				<a class="next" rel="next" href="/2023/08/26/%E4%B8%80%E4%BA%8C%E4%B8%89%E4%BB%A3%E5%A3%B3%E5%92%8C%E5%A3%B3%E6%8A%80%E6%9C%AF%E5%88%86%E7%B1%BB%E8%AF%86%E5%88%AB/">
					<span class="title flex justify-center items-center">
						<span class="post-nav-title-item">一二三代壳和壳技术分类识别</span>
						<span class="post-nav-item">下一篇</span>
					</span>
					<span class="right arrow-icon flex justify-center items-center">
						<i class="fa-solid fa-chevron-right"></i>
					</span>
				</a>
			</div>
			
		</div>
		


		
		<div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
			<div class="comments-container mt-10 w-full ">
    <div id="comment-anchor" class="w-full h-2.5"></div>
    <div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
        评论
    </div>
    

        
            


        
    
</div>

		</div>
		
	</div>

	
	<div class="toc-content-container">
		<div class="post-toc-wrap">
	<div class="post-toc">
		<div class="toc-title">目录</div>
		<div class="page-title">Dalvik下一代壳的通用解决方案</div>
		<ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Dalvik%E4%B8%8BDexClassLoader%E5%8A%A0%E8%BD%BDdex%E6%BA%90%E7%A0%81%E6%B5%81%E7%A8%8B%E5%88%86%E6%9E%90"><span class="nav-text">Dalvik下DexClassLoader加载dex源码流程分析</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9F%A5%E6%89%BECPP%E6%BA%90%E7%A0%81"><span class="nav-text">查找CPP源码</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%AC%AC%E4%B8%80%E7%A7%8D%E6%96%B9%E6%B3%95"><span class="nav-text">第一种方法</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%AC%AC%E4%BA%8C%E7%A7%8D%E6%96%B9%E6%B3%95"><span class="nav-text">第二种方法</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Dalvik%E4%B8%8B%E9%80%9A%E7%94%A8%E8%84%B1%E5%A3%B3%E6%96%B9%E6%A1%88"><span class="nav-text">Dalvik下通用脱壳方案</span></a></li></ol></li></ol>

	</div>
</div>
	</div>
	
</div>
			</div>

			
		</div>

		<div class="main-content-footer">
			<footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
    <div class="info-container py-3 text-center">
        
        <div class="text-center">
            &copy;
            
              <span>2022</span>
              -
            
            2025&nbsp;&nbsp;<i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i>&nbsp;&nbsp;<a href="/">xiaoeryu</a>
            
                
                <p class="post-count space-x-0.5">
                    <span>
                        共撰写了 112 篇文章
                    </span>
                    
                </p>
            
        </div>
        
            <script data-swup-reload-script src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
            <div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
                
                    <span id="busuanzi_container_site_uv" class="lg:!block">
                        <span class="text-sm">访问人数</span>
                        <span id="busuanzi_value_site_uv"></span>
                    </span>
                
                
                    <span id="busuanzi_container_site_pv" class="lg:!block">
                        <span class="text-sm">总访问量</span>
                        <span id="busuanzi_value_site_pv"></span>
                    </span>
                
            </div>
        
        <div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
            <span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
            <span class="text-sm lg:block">主题&nbsp;<a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.8.2</a></span>
        </div>
        
        
            <div>
                博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
            </div>
        
        
            <script data-swup-reload-script>
                try {
                    function odometer_init() {
                    const elements = document.querySelectorAll('.odometer');
                    elements.forEach(el => {
                        new Odometer({
                            el,
                            format: '( ddd).dd',
                            duration: 200
                        });
                    });
                    }
                    odometer_init();
                } catch (error) {}
            </script>
        
        
        
    </div>  
</footer>
		</div>
	</div>

	
	<div class="post-tools">
		<div class="post-tools-container">
	<ul class="article-tools-list">
		<!-- TOC aside toggle -->
		
		<li class="right-bottom-tools page-aside-toggle">
			<i class="fa-regular fa-outdent"></i>
		</li>
		

		<!-- go comment -->
		
		<li class="go-comment">
			<i class="fa-regular fa-comments"></i>
		</li>
		
	</ul>
</div>
	</div>
	

	<div class="right-side-tools-container">
		<div class="side-tools-container">
	<ul class="hidden-tools-list">
		<li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
			<i class="fa-regular fa-magnifying-glass-plus"></i>
		</li>

		<li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
			<i class="fa-regular fa-magnifying-glass-minus"></i>
		</li>

		<li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
			<i class="fa-regular fa-moon"></i>
		</li>

		<!-- rss -->
		

		

		<li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
			<i class="fa-regular fa-arrow-down"></i>
		</li>
	</ul>

	<ul class="visible-tools-list">
		<li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
			<i class="fa-regular fa-cog fa-spin"></i>
		</li>
		
		<li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
			<i class="arrow-up fas fa-arrow-up"></i>
			<span class="percent"></span>
		</li>
		
		
	</ul>
</div>
	</div>

	<div class="image-viewer-container">
	<img src="">
</div>

	
	<div class="search-pop-overlay">
	<div class="popup search-popup">
		<div class="search-header">
			<span class="search-input-field-pre">
				<i class="fa-solid fa-keyboard"></i>
			</span>
			<div class="search-input-container">
				<input autocomplete="off" autocorrect="off" autocapitalize="off" placeholder="站内搜索您需要的内容..." spellcheck="false" type="search" class="search-input">
			</div>
			<span class="popup-btn-close">
				<i class="fa-solid fa-times"></i>
			</span>
		</div>
		<div id="search-result">
			<div id="no-result">
				<i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
			</div>
		</div>
	</div>
</div>
	

</main>



<script src="/js/build/libs/Swup.min.js"></script>

<script src="/js/build/libs/SwupSlideTheme.min.js"></script>

<script src="/js/build/libs/SwupScriptsPlugin.min.js"></script>

<script src="/js/build/libs/SwupProgressPlugin.min.js"></script>

<script src="/js/build/libs/SwupScrollPlugin.min.js"></script>

<script src="/js/build/libs/SwupPreloadPlugin.min.js"></script>

<script>
    const swup = new Swup({
        plugins: [
            new SwupScriptsPlugin({
                optin: true,
            }),
            new SwupProgressPlugin(),
            new SwupScrollPlugin({
                offset: 80,
            }),
            new SwupSlideTheme({
                mainElement: ".main-content-body",
            }),
            new SwupPreloadPlugin(),
        ],
        containers: ["#swup"],
    });
</script>




	
<script src="/js/build/tools/imageViewer.js" type="module"></script>

<script src="/js/build/utils.js" type="module"></script>

<script src="/js/build/main.js" type="module"></script>

<script src="/js/build/layouts/navbarShrink.js" type="module"></script>

<script src="/js/build/tools/scrollTopBottom.js" type="module"></script>

<script src="/js/build/tools/lightDarkSwitch.js" type="module"></script>

<script src="/js/build/layouts/categoryList.js" type="module"></script>



    
<script src="/js/build/tools/localSearch.js" type="module"></script>




    
<script src="/js/build/tools/codeBlock.js" type="module"></script>




    
<script src="/js/build/layouts/lazyload.js" type="module"></script>




    
<script src="/js/build/tools/runtime.js"></script>

    
<script src="/js/build/libs/odometer.min.js"></script>

    
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">




  
<script src="/js/build/libs/Typed.min.js"></script>

  
<script src="/js/build/plugins/typed.js" type="module"></script>








    
<script src="/js/build/libs/anime.min.js"></script>





    
<script src="/js/build/tools/tocToggle.js" type="module" data-swup-reload-script=""></script>

<script src="/js/build/layouts/toc.js" type="module" data-swup-reload-script=""></script>

<script src="/js/build/plugins/tabs.js" type="module" data-swup-reload-script=""></script>




<script src="/js/build/libs/moment-with-locales.min.js" data-swup-reload-script=""></script>


<script src="/js/build/layouts/essays.js" type="module" data-swup-reload-script=""></script>





	
</body>

</html>